package com.xxx.car.mapper;

import com.xxx.car.entity.TbCoupon;
import com.xxx.car.entity.vo.request.ReqCouponQuery;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface TbCouponMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TbCoupon record);

    int insertSelective(TbCoupon record);

    TbCoupon selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TbCoupon record);

    int updateByPrimaryKey(TbCoupon record);

    void updateForExpire(@Param("userId") Integer userId, @Param("newStatus") int newStatus, @Param("currentStatus") int currentStatus, @Param("currentDate") Date currentDate);

    List<TbCoupon> query(ReqCouponQuery query);

    int queryUserCouponCount(@Param("userId") Integer userId);
}